package com.neuedu.api.lang;

/**
 * @author 金山
 * 项目：javase
 * site: https://blog.fulfill.com.cn
 * 描述   所有类都是object 子类型
 * @data 2024/10/2116:20
 */
public class MyObject  {


    public static void main(String[] args) {

        MyObject obj1 = new MyObject();
        MyObject obj3 = new MyObject();
        Object obj2 = new MyObject();
        Object obj4  = obj1;


        System.out.println("obj2 instanceof  Object : "+(obj2 instanceof  Object));
        System.out.println("obj1 instanceof  Object : "+(obj1 instanceof  Object));

        print(100);
        print("aaaaa");


        //false
        System.out.println("(obj1 == obj3) = " + (obj1 == obj3));


        System.out.println("obj1.hashCode() = " + obj1.hashCode());
        System.out.println("obj2.hashCode() = " + obj2.hashCode());
        System.out.println("obj4.hashCode() = " + obj4.hashCode());


    //    HashMap

        /***
         *  obj1   obj2
         */

    }

    public  static  void print(Object obj){
        System.out.println(obj);
    }




}
